inherited fmAddEditDoc_fmDeti: TfmAddEditDoc_fmDeti
  Left = 13
  Top = 207
  Width = 1200
  PixelsPerInch = 96
  TextHeight = 13
  inherited Label10: TLabel
    Left = 16
    Top = 362
  end
  inherited Label11: TLabel
    Left = 15
    Top = 413
  end
  inherited Label12: TLabel
    Left = 176
    Top = 413
  end
  inherited Label13: TLabel
    Left = 16
    Top = 468
  end
  inherited Label14: TLabel
    Left = 16
    Top = 519
  end
  inherited Label32: TLabel
    Left = 18
    Top = 672
  end
  inherited sbType: TSpeedButton
    Left = 319
    Top = 381
  end
  object Label4: TLabel [7]
    Left = 549
    Top = 365
    Width = 26
    Height = 13
    Caption = #1060#1086#1090#1086
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  inherited sbBottom: TStatusBar
    Width = 1192
  end
  inherited Panel1: TPanel
    Width = 1192
    inherited BitBtn1: TBitBtn
      Left = 1020
    end
    inherited BitBtn2: TBitBtn
      Left = 1108
    end
  end
  inherited edCLPASSPORTSERIA: TDBEdit
    Left = 15
    Top = 429
  end
  inherited edCLPASSPORTNUMBER: TDBEdit
    Left = 176
    Top = 429
  end
  inherited mdDNOTE: TDBMemo
    Left = 16
    Top = 689
  end
  inherited edCLPASSPORTDATE: TcxDBDateEdit
    Left = 16
    Top = 485
    Properties.InputKind = ikStandard
    Style.IsFontAssigned = True
  end
  inherited eNAME: TcxTextEdit
    Left = 16
    Top = 381
    Style.IsFontAssigned = True
  end
  inherited edDFROMWHO: TDBMemo
    Left = 16
    Top = 535
  end
  inherited bFromFile: TcxButton
    Left = 731
    Top = 775
  end
  inherited bScan: TcxButton
    Left = 844
    Top = 775
  end
  inherited bDel: TcxButton
    Left = 974
    Top = 775
  end
  inherited Panel2: TPanel
    Left = 588
    inherited AcroPDF1: TAcroPDF
      Left = 3
      Width = 592
      Height = 695
      ControlData = {000800002F3D0000D5470000}
    end
  end
  inherited cxDBCheckBox1: TcxDBCheckBox
    Left = 176
    Top = 488
    Style.IsFontAssigned = True
  end
  object Panel3: TPanel [21]
    Left = 4
    Top = 60
    Width = 577
    Height = 273
    Color = clSkyBlue
    ParentBackground = False
    TabOrder = 13
    object Label33: TLabel
      Left = 12
      Top = 155
      Width = 80
      Height = 13
      Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label3: TLabel
      Left = 298
      Top = 91
      Width = 49
      Height = 13
      Caption = #1054#1090#1095#1077#1089#1090#1074#1086
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label31: TLabel
      Left = 11
      Top = 93
      Width = 19
      Height = 13
      Caption = #1048#1084#1103
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label2: TLabel
      Left = 11
      Top = 16
      Width = 44
      Height = 13
      Caption = #1060#1072#1084#1080#1083#1080#1103
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label1: TLabel
      Left = 11
      Top = 212
      Width = 87
      Height = 13
      Caption = #1057#1090#1072#1090#1091#1089' '#1095#1077#1083#1086#1074#1077#1082#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label8: TLabel
      Left = 368
      Top = 157
      Width = 117
      Height = 13
      Caption = #1057#1090#1077#1087#1077#1085#1100' '#1072#1082#1090#1091#1072#1083#1100#1085#1086#1089#1090#1080
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object edPDATEBIRTH: TcxDBDateEdit
      Left = 10
      Top = 171
      DataBinding.DataField = 'PDATEBIRTH'
      DataBinding.DataSource = DataSource1
      ParentFont = False
      Properties.InputKind = ikStandard
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -19
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.IsFontAssigned = True
      TabOrder = 3
      Width = 151
    end
    object edPPATRONYMIC: TDBEdit
      Left = 296
      Top = 106
      Width = 273
      Height = 33
      DataField = 'PPATRONYMIC'
      DataSource = DataSource1
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clBlack
      Font.Height = -21
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 2
    end
    object edPLASTNAME: TDBEdit
      Left = 9
      Top = 30
      Width = 560
      Height = 47
      DataField = 'PLASTNAME'
      DataSource = DataSource1
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clBlack
      Font.Height = -32
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 0
    end
    object cxDBRadioGroup1: TcxDBRadioGroup
      Left = 176
      Top = 152
      Caption = #1055#1086#1083
      DataBinding.DataField = 'PSEX'
      DataBinding.DataSource = DataSource1
      ParentFont = False
      Properties.Columns = 2
      Properties.Items = <
        item
          Caption = #1052#1091#1078#1089#1082#1086#1081
          Value = 0
        end
        item
          Caption = #1046#1077#1085#1089#1082#1080#1081
          Value = 1
        end>
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -13
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.IsFontAssigned = True
      TabOrder = 4
      Height = 49
      Width = 177
    end
    object cbName: TcxDBLookupComboBox
      Left = 8
      Top = 107
      DataBinding.DataField = 'PNAME'
      DataBinding.DataSource = DataSource1
      ParentFont = False
      Properties.DropDownListStyle = lsEditList
      Properties.KeyFieldNames = 'SDNAME'
      Properties.ListColumns = <
        item
          FieldName = 'SDNAME'
        end>
      Properties.ListSource = dsName
      Properties.MaxLength = 0
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -21
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.IsFontAssigned = True
      TabOrder = 1
      OnExit = cbNameExit
      Width = 281
    end
    object cxDBLookupComboBox1: TcxDBLookupComboBox
      Left = 8
      Top = 228
      DataBinding.DataField = 'SDID'
      DataBinding.DataSource = dsStatus
      ParentFont = False
      Properties.DropDownListStyle = lsEditList
      Properties.KeyFieldNames = 'SDID'
      Properties.ListColumns = <
        item
          SortOrder = soAscending
          FieldName = 'SDNAME'
        end>
      Properties.ListSource = DataSource2
      Properties.MaxLength = 0
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -21
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.IsFontAssigned = True
      TabOrder = 6
      Width = 561
    end
    object cxDBLookupComboBox2: TcxDBLookupComboBox
      Left = 366
      Top = 174
      DataBinding.DataField = 'PSTEP'
      DataBinding.DataSource = dsActualnost
      ParentFont = False
      Properties.DropDownListStyle = lsEditList
      Properties.KeyFieldNames = 'SDID'
      Properties.ListColumns = <
        item
          Caption = ' '#1040#1082#1090#1091#1072#1083#1100#1085#1086#1089#1090#1100
          SortOrder = soAscending
          FieldName = 'SDNAME'
        end>
      Properties.ListSource = DataSource3
      Properties.MaxLength = 0
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.IsFontAssigned = True
      TabOrder = 5
      Width = 201
    end
  end
  object cxDBImage1: TcxDBImage [22]
    Left = 352
    Top = 381
    DataBinding.DataField = 'PPIMAGE'
    DataBinding.DataSource = dsFoto
    Properties.GraphicClassName = 'TJPEGImage'
    TabOrder = 14
    Height = 257
    Width = 225
  end
  inherited dlgDS: TDataSource
    Left = 608
  end
  inherited odScan: TOpenDialog
    Left = 672
    Top = 112
  end
  inherited dsScanDoc: TDataSource
    Left = 608
    Top = 80
  end
  inherited qScanDoc: TIBQuery
    Left = 640
    Top = 80
  end
  inherited quScanDoc: TIBUpdateSQL
    Left = 672
    Top = 80
  end
  object DataSource1: TDataSource
    DataSet = qPeople
    Left = 656
    Top = 224
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT P.*'
      '  FROM People P'
      ' WHERE P.PID = :PID'
      '')
    UpdateObject = quPeople
    GeneratorField.Field = 'PID'
    GeneratorField.Generator = 'GEN_PEOPLE'
    Left = 688
    Top = 224
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeoplePUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeoplePTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeoplePUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeoplePTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeoplePISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeoplePSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
  end
  object quPeople: TIBUpdateSQL
    ModifySQL.Strings = (
      'update PEOPLE'
      'set'
      '  PDATEBIRTH = :PDATEBIRTH,'
      '  PID = :PID,'
      '  PISDELETE = :PISDELETE,'
      '  PLASTNAME = :PLASTNAME,'
      '  PNAME = :PNAME,'
      '  PNOTE = :PNOTE,'
      '  PPATRONYMIC = :PPATRONYMIC,'
      '  PSEX = :PSEX,'
      '  PTIMEEDIT = :PTIMEEDIT,'
      '  PTIMEENTER = :PTIMEENTER,'
      '  PUSEREDIT = :PUSEREDIT,'
      '  PUSERENTER = :PUSERENTER'
      'where'
      '  PID = :OLD_PID')
    InsertSQL.Strings = (
      'insert into PEOPLE'
      
        '  (PDATEBIRTH, PID, PISDELETE, PLASTNAME, PNAME, PNOTE, PPATRONY' +
        'MIC, PSEX, '
      '   PTIMEEDIT, PTIMEENTER, PUSEREDIT, PUSERENTER)'
      'values'
      
        '  (:PDATEBIRTH, :PID, :PISDELETE, :PLASTNAME, :PNAME, :PNOTE, :P' +
        'PATRONYMIC, '
      '   :PSEX, :PTIMEEDIT, :PTIMEENTER, :PUSEREDIT, :PUSERENTER)')
    DeleteSQL.Strings = (
      '')
    Left = 720
    Top = 224
  end
  object dsName: TDataSource
    DataSet = qName
    Left = 664
    Top = 264
  end
  object qName: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 10'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1'
      '')
    GeneratorField.Field = 'SDID'
    Left = 704
    Top = 264
    object qNameSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qNameSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qNameSDNAME: TIBStringField
      DisplayLabel = ' '
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qNameSDISDELETE: TIntegerField
      DisplayLabel = #1059#1076#1072#1083#1080#1090#1100'?'
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object dsStatus: TDataSource
    DataSet = qStatus
    Left = 688
    Top = 392
  end
  object qStatus: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    DataSource = DataSource1
    SQL.Strings = (
      'SELECT PS.*'
      'FROM P_STATUS PS'
      'WHERE PS.PID = :PID'
      '')
    UpdateObject = quStatus
    GeneratorField.Field = 'SDID'
    Left = 728
    Top = 392
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qStatusPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_STATUS"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qStatusSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
    object qStatusPSUSERENTER: TIBStringField
      FieldName = 'PSUSERENTER'
      Origin = '"P_STATUS"."PSUSERENTER"'
      Size = 80
    end
    object qStatusPSTIMEENTER: TDateTimeField
      FieldName = 'PSTIMEENTER'
      Origin = '"P_STATUS"."PSTIMEENTER"'
    end
    object qStatusPSUSEREDIT: TIBStringField
      FieldName = 'PSUSEREDIT'
      Origin = '"P_STATUS"."PSUSEREDIT"'
      Size = 40
    end
    object qStatusPSTIMEEDIT: TDateTimeField
      FieldName = 'PSTIMEEDIT'
      Origin = '"P_STATUS"."PSTIMEEDIT"'
    end
  end
  object quStatus: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID,'
      '  SDID,'
      '  PSUSERENTER,'
      '  PSTIMEENTER,'
      '  PSUSEREDIT,'
      '  PSTIMEEDIT'
      'from P_STATUS '
      'where'
      '  PID = :PID')
    ModifySQL.Strings = (
      'update P_STATUS'
      'set'
      '  PID = :PID,'
      '  PSTIMEEDIT = :PSTIMEEDIT,'
      '  PSTIMEENTER = :PSTIMEENTER,'
      '  PSUSEREDIT = :PSUSEREDIT,'
      '  PSUSERENTER = :PSUSERENTER,'
      '  SDID = :SDID'
      'where'
      '  PID = :OLD_PID')
    InsertSQL.Strings = (
      'insert into P_STATUS'
      '  (PID, PSTIMEEDIT, PSTIMEENTER, PSUSEREDIT, PSUSERENTER, SDID)'
      'values'
      
        '  (:PID, :PSTIMEEDIT, :PSTIMEENTER, :PSUSEREDIT, :PSUSERENTER, :' +
        'SDID)')
    DeleteSQL.Strings = (
      'null;')
    Left = 760
    Top = 392
  end
  object DataSource2: TDataSource
    DataSet = IBQuery1
    Left = 688
    Top = 424
  end
  object IBQuery1: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 12'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE NOT EXISTS'
      '('
      'SELECT t2.sdid'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 12'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t2'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE t2.sdparid = t1.sdid'
      ')')
    GeneratorField.Field = 'SDID'
    Left = 728
    Top = 424
    object IntegerField1: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object IntegerField2: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object IBStringField1: TIBStringField
      DisplayLabel = ' '
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
  end
  object dsActualnost: TDataSource
    DataSet = qActualnost
    Left = 688
    Top = 480
  end
  object qActualnost: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    DataSource = DataSource1
    SQL.Strings = (
      'SELECT PS.*'
      'FROM P_STEPACT PS'
      'WHERE PS.PID = :PID'
      '')
    UpdateObject = quActualnost
    GeneratorField.Field = 'SDID'
    Left = 728
    Top = 480
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qActualnostPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_STEPACT"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qActualnostPSTEP: TIntegerField
      FieldName = 'PSTEP'
      Origin = '"P_STEPACT"."PSTEP"'
    end
  end
  object quActualnost: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID,'
      '  PSTEP'
      'from P_STEPACT '
      'where'
      '  PID = :PID')
    ModifySQL.Strings = (
      'update P_STEPACT'
      'set'
      '  PID = :PID,'
      '  PSTEP = :PSTEP'
      'where'
      '  PID = :OLD_PID')
    InsertSQL.Strings = (
      'insert into P_STEPACT'
      '  (PID, PSTEP)'
      'values'
      '  (:PID, :PSTEP)')
    DeleteSQL.Strings = (
      'null;')
    Left = 760
    Top = 480
  end
  object IBQuery2: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 15'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE NOT EXISTS'
      '('
      'SELECT t2.sdid'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 15'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t2'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE t2.sdparid = t1.sdid'
      ')')
    GeneratorField.Field = 'SDID'
    Left = 728
    Top = 512
    object IntegerField4: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object IntegerField5: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object IBStringField2: TIBStringField
      DisplayLabel = ' '
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
  end
  object DataSource3: TDataSource
    DataSet = IBQuery2
    Left = 688
    Top = 512
  end
  object dsFoto: TDataSource
    Left = 536
    Top = 392
  end
end
